package org.bright.controller;

import org.bright.dto.LoginUserDTO;
import org.bright.entity.Employees;
import org.bright.entity.R;
import org.bright.service.IEmployeesService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("loginEmployee")
@CrossOrigin
public class LoginController {
    @Autowired
    private IEmployeesService employeeService;
    //    登录
    @GetMapping
    public R login(LoginUserDTO loginUserDto){
        Employees employees1 = employeeService.selectAllByLoginNameAndPassword(loginUserDto.getLoginName(),loginUserDto.getPassword());
        return R.success(employees1);
    }
}
